package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

@Mapper
public interface UserMapper {


    User selectByopenid(String openid);

    void insertUser(User user);

    @Select("select * from sky_take_out.user where id=#{userId};")
    User getById(Long userId);


    @Select("select count(*) from sky_take_out.user where create_time>=#{begin} and create_time<=#{end};")
    Integer selectByCreateTime(LocalDateTime begin, LocalDateTime end);

    @Select("select count(*) from sky_take_out.user;")
    Integer select();

    Integer countByMap(Map map);

}
